﻿using System;
using System.Collections.Generic; 
using System.Text;
using Runda.CMS.Dal;
using Runda.CMS.Common.Utility;

namespace Runda.CMS.Bll
{
    public class ContractCalculateBll:BllBase
    {
        #region 公共

        /// <summary>
        /// 获取合同销售总价
        /// </summary>
        /// <param name="ContractID"></param>
        /// <returns></returns>
        public decimal SumContractPutItemPrice(Guid ContractID)
        {
            CtrtContractItemDal dal = new CtrtContractItemDal();
            return dal.SumContractPutItemPrice(ContractID);
        }

        public decimal SumContractSaleItemPrice(Guid ContractID)
        {
            CtrtContractItemDal dal = new CtrtContractItemDal();
            return dal.SumContractSaleItemPrice(ContractID);
        }

        public decimal SumContractItemTotalPrice(Guid ContractID)
        {
            CtrtContractItemDal dal = new CtrtContractItemDal();
            return dal.SumContractItemTotalPrice(ContractID);
        }
        /// <summary>
        /// 获取合同成本
        /// </summary>
        /// <param name="ContractID"></param>
        /// <param name="Type"></param>
        /// <returns></returns>
        public decimal SumContractItemCost(Guid ContractID)
        {
            CtrtContractItemDal dal = new CtrtContractItemDal();
            return dal.SumContractItemCost(ContractID);
        }

        /// <summary>
        /// 获取某种类型的合同成本
        /// </summary>
        /// <param name="ContractID"></param>
        /// <param name="Type"></param>
        /// <returns></returns>
        public decimal SumContractItemCost(Guid ContractID, int Type)
        {
            CtrtContractItemDal dal = new CtrtContractItemDal();
            return dal.SumContractItemCost(ContractID, Type);
        }

        /// <summary>
        /// 获取试剂成本
        /// </summary>
        /// <param name="ContractID"></param>
        /// <returns></returns>
        public decimal SumContractItemCostFor01(Guid ContractID)
        {
            CtrtContractItemDal dal = new CtrtContractItemDal();
            return dal.SumContractItemCostFor01(ContractID);
        }

         /// <summary>
        /// 获取配套商品的成本
        /// </summary>
        /// <param name="ContractID"></param>
        /// <returns></returns>
        public decimal GetContractGiftCost(Guid ContractID)
        {
            CtrtContractGiftDal dal = new CtrtContractGiftDal();
            return dal.GetContractGiftCost(ContractID);
        }
        #endregion

        #region 销售合同

        public decimal GetContractItemPartCost(Guid ItemID)
        {
            CtrtContractItemPartDal dal = new CtrtContractItemPartDal();
            return dal.GetContractItemPartCost(ItemID);
        }

        public decimal GetContractPayment(Guid ContractID)
        {
            CtrtContractPaymentDal dal = new CtrtContractPaymentDal();
            return dal.GetContractPayment(ContractID);
        }
        #endregion

        #region 投放合同

        #endregion
    }
}
